package com.qiall.gateway.controller.websocket;

import javax.websocket.Session;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class SessionPool {
    private static Map<String, Session> sessionMap = new ConcurrentHashMap<>();

    public static void addSession(Session session) {
        sessionMap.put(session.getId(), session);
    }

    public static Session getSession(String key) {
        return sessionMap.get(key);
    }

    public static void remove(String key) {
        sessionMap.remove(key);
    }
}
